from flask import Flask, jsonify
from flask_cors import CORS
from analyse_data.analyse_data import *

app = Flask(__name__)
CORS(app, resources=r'/*')


@app.route('/')
def hello_world():  # put application's code here
    return 'Hello World!'


@app.route('/line', methods=['POST'])
def line():
    return jsonify(every_year_car_count())


@app.route('/bar', methods=['POST'])
def bar():
    return jsonify(score_top10())


@app.route('/tree', methods=['POST'])
def tree():
    return jsonify(all_car_tree())


@app.route('/wordCloud', methods=['POST'])
def word_cloud():
    return jsonify(brand_word_cloud())


@app.route('/funnel', methods=['POST'])
def funnel():
    return jsonify(price_level_funnel())


if __name__ == '__main__':
    app.run()
